<template>
  <el-row>this is home</el-row>
  <el-row>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="id" label="ID" width="180" />
      <el-table-column prop="username" label="Username" width="180" />
      <el-table-column prop="password" label="Password" width="180" />
      <el-table-column prop="email" label="Email" />
    </el-table>
  </el-row>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { fetchUserList } from '../../http/user'
import type { User } from '../../http/type'
defineOptions({ name: 'Home' })
const tableData = ref<User[]>([])
onMounted(() => {
  console.log('home')
  fetchUserList().then((res) => {
    console.log(res.data.data)
    tableData.value = res.data.data
  })
})
</script>
